<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.geoserver.community</groupId>
    <artifactId>gs-rest-openapi-generated</artifactId>
    <version>2.26-SNAPSHOT</version>
  </parent>
  <artifactId>gs-rest-openapi-generated-feign-client</artifactId>
  <packaging>jar</packaging>
  <name>OpenAPI generated Feign client</name>
  <properties>
    <openapi-base-folder>${project.parent.parent.basedir}/openapi/src/main/resources/org/geoserver/rest/openapi/1.0.0</openapi-base-folder>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.geoserver.community</groupId>
      <artifactId>gs-rest-openapi-generated-model</artifactId>
      <version>${project.version}</version>
    </dependency>
    <!-- HTTP client: Netflix Feign -->
    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-okhttp</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-slf4j</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign.form</groupId>
      <artifactId>feign-form</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.oltu.oauth2</groupId>
      <artifactId>org.apache.oltu.oauth2.client</artifactId>
    </dependency>

    <!-- JSON processing: jackson -->
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.openapitools</groupId>
        <artifactId>openapi-generator-maven-plugin</artifactId>
        <version>${openapi-generator-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>generate-api-model</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/catalogresponses.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateApis>false</generateApis>
              <generateSupportingFiles>true</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-manifests-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/manifests.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-settings-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/settings.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-workspaces-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/workspaces.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-namespaces-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/namespaces.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-datastores-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/datastores.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-coveragestores-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/coveragestores.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-featuretypes-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/featuretypes.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-coverages-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/coverages.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-layers-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/layers.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-styles-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/styles.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-owsservices-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/owsservices.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
          <execution>
            <id>generate-urlchecks-api</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorName>java</generatorName>
              <inputSpec>${openapi-base-folder}/urlchecks.yaml</inputSpec>
              <configurationFile>${project.basedir}/client-api-config.json</configurationFile>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generateModelTests>false</generateModelTests>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelDocumentation>false</generateModelDocumentation>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source-generated</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/openapi/src</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
